package com.lvhaosb.newpneumonia.service.impl;

import com.lvhaosb.newpneumonia.POJO.po.Country;
import com.lvhaosb.newpneumonia.mapper.CountryMapper;
import com.lvhaosb.newpneumonia.service.CountryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 国家 服务实现类
 *
 * @author lvhao
 * @since 2020-06-21
 */
@Service
public class CountryServiceImpl implements CountryService {
    @Autowired
    private CountryMapper countryMapper;

    @Override
    public List<Country> getAll() {
        return countryMapper.selectAll();
    }

    @Override
    @Transactional
    public Boolean save(Country country) {
        if(countryMapper.insert(country) > 0){
            return true;
        }
        return false;
    }

}
